package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.Alarm;
import com.bocloud.common.model.Param;
import com.bocloud.common.model.SimpleBean;
import com.bocloud.database.core.intf.GenericDao;

/**
 * 告警操作 DAO接口
 * 
 * @author beyond
 *
 */
public interface AlarmDao extends GenericDao<Alarm, Long> {

	/**
	 * 告警查询接口
	 * 
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<Alarm> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;

	public List<SimpleBean> list(List<Param> params, Map<String, String> sorter) throws Exception;

	public int count(List<Param> params) throws Exception;

	/**
	 * 根据云供应商ID删除
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public boolean removeByVid(Long vendorId, Long userId) throws Exception;

	/**
	 * 根据平台Id查询
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public List<Alarm> listByVendor(Long vendorId) throws Exception;

	/**
	 * 删除
	 * 
	 * @param id
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public Boolean delete(Long id, Long userId) throws Exception;

	/**
	 * 根据vendorId删除所属平台的所有告警信息(物理删除)
	 * 
	 * @param vendorId
	 * @throws Exception
	 */
	public int deleteByVendorId(Long vendorId) throws Exception;

	/**
	 * 根据ID查询
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Alarm query(Long id) throws Exception;

	/**
	 * 根据平台类型查询
	 * 
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @param type
	 * @return
	 * @throws Exception
	 */
	public List<Alarm> list(int page, int rows, List<Param> params, Map<String, String> sorter, String type)
			throws Exception;

	/**
	 * 数量
	 * 
	 * @param params
	 * @param type
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params, String type) throws Exception;

	/**
	 * 获取所有的告警
	 * 
	 * @return
	 * @throws Exception
	 */
	public List<Alarm> listAll() throws Exception;
}
